<?php

/**
search form for invoice
class: myInvoiceSearchForm
author: milwell
date: 2008-11-30 13:51
*/

  class myReceivablesForm extends sfForm{
    
    public function configure(){
    
      $this->setWidgets(
        array(
          'owner_iden' =>  new sfWidgetFormSelect(array('choices'=>AccountOwnerPeer::getList(),)),
          'asof_date' => new sfWidgetFormDate(),
        )
      );
      
      
      $this->setValidators(array(
        'owner_iden' => new sfValidatorDate(array('required'=>true,)),
        'asof_date' => new sfValidatorDate(array('required'=>true,)),
      ));
      
      $this->widgetSchema->setLabels(
        array(
          'owner_iden' => 'Owner:',
          'asof_date' => 'As of:',
        )
      );
      
      $years = range(date('Y')-50,date('Y')+1);
      $this->widgetSchema['asof_date']->setOption('years',array_combine($years,$years));
      
      $this->widgetSchema->setNameFormat('rkey_receivables[%s]');
      
    }
    
  }

?>